home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 26 / AACD 26.iso / AACD / Online / PHP / include / php / ext / standard / php_incomplete_class.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-02-26  |  2.3 KB  |  66 lines

  1. /*
  2.    +----------------------------------------------------------------------+
  3.    | PHP version 4.0                                                      |
  4.    +----------------------------------------------------------------------+
  5.    | Copyright (c) 1997-2001 The PHP Group                                |
  6.    +----------------------------------------------------------------------+
  7.    | This source file is subject to version 2.02 of the PHP license,      |
  8.    | that is bundled with this package in the file LICENSE, and is        |
  9.    | available at through the world-wide-web at                           |
  10.    | http://www.php.net/license/2_02.txt.                                 |
  11.    | If you did not receive a copy of the PHP license and are unable to   |
  12.    | obtain it through the world-wide-web, please send a note to          |
  13.    | license@php.net so we can mail you a copy immediately.               |
  14.    +----------------------------------------------------------------------+
  15.    | Author:  Sascha Schumann <sascha@schumann.cx>                        |
  16.    +----------------------------------------------------------------------+
  17. */
  18.  
  19. /* $Id: php_incomplete_class.h,v 1.4 2001/02/26 06:07:23 andi Exp $ */
  20.  
  21. #ifndef PHP_INCOMPLETE_CLASS_H
  22. #define PHP_INCOMPLETE_CLASS_H
  23.  
  24. #include "ext/standard/basic_functions.h"
  25.  
  26. #define PHP_IC_ENTRY \
  27.     BG(incomplete_class)
  28.  
  29. #define PHP_IC_ENTRY_READ \
  30.     (PHP_IC_ENTRY ? PHP_IC_ENTRY : php_create_incomplete_class(BLS_C))
  31.  
  32.  
  33. #define PHP_SET_CLASS_ATTRIBUTES(struc)                 \
  34.     if ((struc)->value.obj.ce == BG(incomplete_class)) {                \
  35.         class_name = php_lookup_class_name(struc, &name_len, 1);        \
  36.         free_class_name = 1;                                            \
  37.     } else {                                                            \
  38.         class_name = (struc)->value.obj.ce->name;                        \
  39.         name_len   = (struc)->value.obj.ce->name_length;                \
  40.     }
  41.  
  42. #define PHP_CLEANUP_CLASS_ATTRIBUTES()                                    \
  43.     if (free_class_name) efree(class_name)
  44.  
  45. #define PHP_CLASS_ATTRIBUTES                                            \
  46.     char *class_name;                                                    \
  47.     size_t name_len;                                                    \
  48.     zend_bool free_class_name = 0                                        \
  49.  
  50.  
  51.  
  52. #ifdef __cplusplus
  53. extern "C" {
  54. #endif
  55.  
  56. zend_class_entry *php_create_incomplete_class(BLS_D);
  57.  
  58. char *php_lookup_class_name(zval *object, size_t *nlen, zend_bool del);
  59. void  php_store_class_name(zval *object, const char *name, size_t len);
  60.  
  61. #ifdef __cplusplus
  62. };
  63. #endif
  64.  
  65. #endif
  66.